<?php
error_reporting(E_ERROR );
class template
{
	var $parameters = array();
	var $template;
	var $html;

	function set_template($tpl)
	{
		$this->template = $tpl;
		return true;
	}

	function set_parameter($variable, $value)
	{
		if(is_array($value))
		{
			$variable2 = '';
			foreach($value as $key => $val)
				$variable2 .= $val.', ';
			$this->parameters[$variable] = $variable2;
		}
		else
			$this->parameters[$variable] = $value;
		return true;
	}

	function show()
	{
		$this->html = implode("", file($this->template));
		foreach($this->parameters as $key => $value)
		{
			$temp = '['.$key.']';
			$this->html = str_replace($temp, $value, $this->html);
		}
		return $this->html;
	}
}

?>